package com.bruce.spring.http.client.controller;

import com.bruce.spring.http.api.PayClient;
import com.bruce.spring.http.api.Store;
import com.bruce.spring.http.client.factory.ClientFactory;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.service.annotation.PostExchange;

/**
 * Created by bruce in 2025/7/2 17:49
 */
@AllArgsConstructor
@RestController
public class PayClientController {

    private ClientFactory clientFactory;

    @PostExchange("/apps/{name}/tenant/{data}/labels")
    public Boolean createLabels(@PathVariable("name") String name,
                                @PathVariable("data") String data,
                                @RequestBody Store req) {

        PayClient payClient = clientFactory.getClient("D1", PayClient.class);

        return payClient.createLabels(req, name);
    }


}
